<template>
  <div class="inline" @click="handleClick(scope.row)" v-html="getValue(scope.row)"></div>
</template>

<script>
  export default {
    name:'ColumnLink',
    props:{
      scope:Object,
      column:{
        type:Object
      }
    },
    methods:{
      getValue(row){
        let html = this.column.html || `<span class="linkurl">$1</span>`;
        let val = row[this.column.prop];
        return html.replace("$1",val == void 0?'':val);
      },
      handleClick(row){
        let fun = this.column.onClick;
        if(fun){
          fun(row);
        }
      }
    }
  }
</script>
